<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>login</title>
    <link rel="stylesheet" type="text/css" href="../css/normalize.css"/>
    <link rel="stylesheet" type="text/css" href="../css/demo.css"/>
    <!--必要样式-->
    <link rel="stylesheet" type="text/css" href="../css/component.css"/>
    <script src="/js/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/sweetalert2/sweetalert2.min.css">
    <script src="/js/plugins/sweetalert2/sweetalert2.min.js"></script>
    <!--[if IE]>
    <script src="/js/html5.js"></script>
    <![endif]-->
</head>
<body>
<div class="container demo-1">
    <div class="content">
        <div id="large-header" class="large-header">
            <canvas id="demo-canvas"></canvas>
            <div class="logo_box">
                <h3>欢迎登陆</h3>
                <form action="#" name="f" method="post">
                    <div class="input_outer">
                        <span class="u_user"></span>
                        <input class="text" id="name" value="admin" style="color: #FFFFFF !important" type="text" placeholder="请输入账户">
                    </div>
                    <div class="input_outer">
                        <span class="us_uer"></span>
                        <input class="text" id="password"
                               style="color: #FFFFFF !important; position:absolute; z-index:100;" value="1"
                               type="password" placeholder="请输入密码">
                    </div>
                    <div class="mb2"><a class="act-but submit" id="login" href="javascript:;"
                                        style="color: #FFFFFF">登录</a></div>
                </form>
            </div>
        </div>
    </div>
</div><!-- /container -->
<script src="../js/TweenLite.min.js"></script>
<script src="../js/EasePack.min.js"></script>
<script src="../js/rAF.js"></script>
<script src="../js/demo-1.js"></script>

<script>
    $('#login').click(function () {
        var name = $('#name').val();
        var password = $('#password').val();
        $.post('/empLogin', {name: name, password: password}, function (data) {
            if (data.success) {
                Swal.fire({
                    title: '登陆成功',
                    icon: 'success',
                });

				window.location.href = "/employee/list";

            } else {
                console.log(data);
                Swal.fire({
                    title: data.msg,
                    icon: 'warning',
                })
            }
        })
    })
</script>
</body>
</html>